<!--自定义加载状态-->
<script setup>
import { defineEmits, defineProps } from 'vue'

const props = defineProps({
  show: {
    type: Boolean,
    required: true
  },
  isModelClose: {
    type: Boolean,
    default: true
  },
  text: {
    type: String,
    default: '努力加载中~'
  }
})
const emit = defineEmits(['update:show'])

const closeDialog = () => {
  if (props.isModelClose) {
    emit('update:show', false)
  }
}
</script>

<template>
  <van-overlay :show="show" z-index="100">
    <div
      class="box-border w-full h-full grid place-items-center"
      @click.stop="closeDialog"
    >
      <van-loading vertical type="circular" color="#229f60">
        {{ text }}
      </van-loading>
    </div>
  </van-overlay>
</template>

<style scoped lang="less">
.van-overlay {
  background-color: rgba(255, 255, 255, 0.3);
}
</style>
